<template>
    <div>
        <el-card class="box-card">

        </el-card>
        <el-table :data="couponList" height="250" style="width: 100%">
            <el-table-column prop="name" label="优惠卷名称" width="180" />
            <el-table-column prop="name" label="状态" width="180" />
            <el-table-column prop="address" label="优惠">
                <template #default="{ row }">
                    {{ row.type ? "满减" : "折扣" }}{{ row.type ? ("$" + row.value) : (row.value + '折') }}

                </template>
            </el-table-column>
            <el-table-column prop="address" label="发放数量" />
            <el-table-column prop="address" label="已使用" />
            <el-table-column prop="address" label="操作">
                <template #default="{ row }">

                </template>
            </el-table-column>
        </el-table>
    </div>
</template>
<script setup lang='ts'>
import { ref } from 'vue'
import { couponListApi } from '@/api/coupon'

// 当前页数
const page = ref(1)
// 优惠卷列表
const couponList = ref()

const getCouponList = () => {
    couponListApi(page.value).then(res => {
        console.log(res);
        couponList.value = res.data.data.list
    })
}
getCouponList()

</script>
<style lang='scss' scoped></style>